<template>
  <div class="about">
    <h1>This is an about page</h1>
  </div>
</template>

<script>
    export default{
        name:'About',
        data () {
          return {
            msg:'这是组件的路由守卫'
          }
        },
        //组件内的路由守卫
        beforeRouteEnter(to, from, next){
            // console.log(to);
            // console.log(from);
            // console.log(this.msg);
            // next();
        },
        beforeRouteLeave(to, from, next){
            console.log(to);
            console.log(from);
            console.log(this.msg);
            next();
        },
        beforeRouteUpdate(to, from, next){
            // console.log(to);
            // console.log(from);
            // console.log(this.msg);
            // next()
        }
          
          
        
    }
</script>
